package com.example.binpacking.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.binpacking.model.QuestionnaireName;
import com.example.binpacking.model.SubjectView;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

@Mapper
public interface QuestionnaireNameMapper extends BaseMapper<QuestionnaireName>{
    @Select("SELECT id,name,isdeleted,orderid FROM tbl_dictionary_questionnaire WHERE isdeleted = #{isdeleted} ")
    Page<QuestionnaireName> selectNameByIsdeleted(Page<QuestionnaireName> page, @Param("isdeleted") BigDecimal isdeleted);

    @Update("update tbl_dictionary_questionnaire set name= #{name} where id= #{id}")
    int updateByName(@Param("id")BigDecimal id,@Param("name")String name);

    @Update("update tbl_dictionary_questionnaire set isdeleted= #{isdeleted} where id= #{id}")
    int updateDeletedById(@Param("id")BigDecimal id,@Param("isdeleted")BigDecimal isdeleted);

}
